/*
 * Created on 09.10.2006 by leck
 *
 */
package de.devisnik.eidle.picture;

import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;

public class SlideshowPreferencePage extends FieldEditorPreferencePage
		implements IWorkbenchPreferencePage {

	public SlideshowPreferencePage() {
		super("Slide Show", GRID);
		setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(),
				PictureActivator.PLUGIN_ID));
	}

	// @Override
	protected void createFieldEditors() {
		// BooleanFieldEditor isEnabledEditor = new BooleanFieldEditor(
		// SlideShowPreferences.KEY_ENABLED, "enabled",
		// getFieldEditorParent());
		// addField(isEnabledEditor);
		final DirectoryFieldEditor globalImagePathEditor = new DirectoryFieldEditor(
				SlideShowPreferences.KEY_GLOBAL_IMAGE_PATH, "Image directory",
				getFieldEditorParent());
		addField(globalImagePathEditor);
		final IntegerFieldEditor presentationTimeEditor = new IntegerFieldEditor(
				SlideShowPreferences.KEY_PRESENTATION_TIME,
				"Presentation time (in s)", getFieldEditorParent());
		presentationTimeEditor.setValidRange(6, 600);
		addField(presentationTimeEditor);
	}

	public void init(final IWorkbench workbench) {
	}

}
